#!/bin/bash

# 设置SELinux为enforcing
sudo sed -i 's/^SELINUX=.*/SELINUX=enforcing/' /etc/selinux/config

# 设置策略为targeted
sudo sed -i 's/^SELINUXTYPE=.*/SELINUXTYPE=targeted/' /etc/selinux/config

# 立即生效
setenforce 1 2>/dev/null
